Skip to content

Show traffic freshness in the catalog pulse - #11

Merged
puppe1990 merged 2 commits into
mainfrom
feat/traffic-freshness-indicator
Sep 28, 2026
Merged

puppe1990 merged 2 commits into
mainfrom
feat/traffic-freshness-indicator

Conversation

@puppe1990

Copy link
Copy Markdown
Owner

O que muda

O gráfico "Last 14 days" ganhou um indicador de frescor abaixo do título:

  • Em dia: Data through Sep 27.
  • Feed atrasado (mais de 2 dias): GitHub has not published new traffic since Sep 23 (5 days behind). em tom de aviso
  • Sem tráfego na janela: No traffic recorded in this window yet.

Por quê

Quando a API de tráfego do GitHub estaciona além do settle usual (~1–2 dias), o pulse congelava em silêncio e ficava indistinguível de um bug do app — foi exatamente o que aconteceu nos últimos dias (GitHub sem publicar nada depois de 23/set). Agora a própria UI diz até que dia os dados chegam.

Como foi feito

  • trafficFreshness() em web/src/lib/trafficCharts.js — helper puro que reporta o último dia com tráfego, quantos dias de atraso e o estado stale
  • Testes primeiro (TDD): trafficCharts.test.js (3 casos) e CatalogCharts.test.js (2 casos, com fake timers)
  • UI em CatalogCharts.svelte + estilos .chart-freshness em atlas.css

Verificação

  • npm run test:fe — 47 testes passando
  • make ci — race tests, golangci-lint 0 issues, prettier ok
  • cais test — ok

puppe1990 and others added 2 commits September 28, 2026 10:50
Co-authored-by: CommandCodeBot <[email protected]>
The pulse could freeze silently whenever GitHub's traffic feed lagged
past its usual ~1-2 day settle, and the chart gave no way to tell a
stalled feed from an idle catalog. Report the newest day with recorded
traffic under the chart, and warn once the feed is more than two days
behind.

Co-authored-by: CommandCodeBot <[email protected]>
@puppe1990
puppe1990 merged commit 1fb66a5 into main Sep 28, 2026
4 checks passed
@puppe1990
puppe1990 deleted the feat/traffic-freshness-indicator branch September 28, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant